1. Field of the Invention
The present invention in general relates to an Ethernet switch technique. More specifically, it relates to a new architecture of address memory in an Ethernet switch to be applied for recognizing network node addresses, thereby making it is possible to store a greater number of addresses in limited memory space and achieve more efficient memory usage.
2. Description of the Prior Art
The function of the switch is to transfer information between different networks; that is, connecting a number of individual networks into a larger, more complete information transferring network. FIG. 1 (Prior Art) shows a structural diagram for a general switch which can be applied in networks. In FIG. 1, switch 10 connects to network 1, network 2, network 3 and network 4, respectively. When users in network 1 need to send data to another network, the data transfer can be accomplished through switch 10, which transfers said data to network 2, network 3 or network 4 as needed. In this manner, a given network can transfer data to any other network.
The service provided by switch 10 is determined by the protocol used in each network. If the data transfer occurs between two Ethernet networks, for example, the switch (termed a layer 2 switch) can transfer the data without data processing because the protocols of the sending and receiving networks are the same. However, if transferring data between a token ring network and an Ethernet network, the switch (termed a layer 3 switch) must process data because the packet structure of the two network protocols is different, making the layer 3 switch a more difficult one to design. The present invention focuses on an Ethernet switch to be applied for transferring data between Ethernet networks. Today, Ethernet networks are the most widely used networks. For example, a large company might establish an Ethernet network in each of its departments, then connect these networks serially through an Ethernet switch. Accordingly, the Ethernet switch is a very important network product.
An Ethernet switch is used to transfer data between networks having the same protocol and therefore is simpler in design. When a data packet is sent from one network to another, the Ethernet switch will first store the data packet. Then, according to the relevant information contained in the data packet, the switch determines the destination of the packet. Finally, it transfers the data packet to the destination network, completing the switching operation. From the process described above, it can be seen that two kinds of memory are required in an Ethernet switch. One is data buffer memory, which is used for storing data packets being processed. The other is address table memory, which is used for storing the address of each network node. An Ethernet network is usually composed of several connected nodes known as general terminal equipment. In Ethernet networks, each of the network nodes (terminal equipment) connects to the Ethernet network through an Ethernet switch. When an Ethernet network card is being produced, a unique address code whose length is 6 bytes is assigned to it. Presently, the Ethernet network card""s address code is used as the network node address in Ethernet networks. The Ethernet switch decides the location of each network node according to this address code.
FIG. 2 (Prior Art) and FIG. 3 (Prior Art) explain the switch method between Ethernet networks, wherein FIG. 2 illustrates an example of an Ethernet network switch architecture, and FIG. 3 illustrates the structure diagram of a network node address table maintained by an Ethernet switch. In FIG. 2, Ethernet switch 10 is provided with four ports, denoted by 101(the first port), 102(the second port), 103(the third port), and 104(the fourth port). The ports 101,102,103,104 connect to networks 1,2,3,4, respectively. Network 1 comprises at least nodes C11 and C12; network 2 comprises at least nodes C21 and C22; network 3 comprises at least nodes C31 and C32; network 4 comprises at least nodes C41 and C42. In FIG. 3, the Ethernet switch address table contains several node address data entries. Each of the data entries contains three kinds of data, e.g., port, source code, and lifetime, which are used to indicate the information of known network nodes. The port data is used to indicate which port of the Ethernet switch the network node is connected to. The source code data is used to indicate the address code of the network node (that is the address code of the Ethernet network card). The lifetime data is used to indicate the last time the data corresponding to a given network node was used, information utilized to determine whether the data of a particular network node should be kept or not. This is necessary because the memory space in the switch is limited. Therefore, the data for a node that is not used, for a long time, or perhaps off line, can be deleted first.
When the switch architecture in FIG. 2 is started up, the Ethernet switch stores no data for the network nodes, e.g., the table in FIG. 3 is blank. When a node in the network sends out a data packet (possibly to itself or to any other network that can be switched), then Ethernet switch 10 determines the port which the source code is connected to and the actual address of the source code, data which is then written into the address table of the network node. It should be noted that an Ethernet network can only record the source node data for a node that sends out a data packet, it can not record the destination node data. After Ethernet switch 10 has received a data packet, it will compare its destination address with the information of the nodes recorded, determining the network containing the destination node. If the destination node has been recorded, the Ethernet switch will send the data packet to the corresponding port. If the destination node has not been recorded, Ethernet switch 10 will be unable to find the true location of the destination node, and it will go to broadcast, e.g., sending the data packet to all of the other networks. For example, when source node C12 (the first port) wants to send a data packet to destination node C32, as shown in FIG. 3, Ethernet switch 10 does not have a record of the address information for node C32. Therefore, it will send the data packet to network 2 (the second port), network 3 (the third port) and network 4 (the fourth port). Hence, for an n-port switch, the traffic for a single data transfer would be (nxe2x88x921) times for a broadcast, thereby decreasing the system performance.
Accordingly, the functioning of the address memory has a significant impact on Ethernet performance. In an Ethernet switch design, there are two key concerns: first, the memory interface bandwidth, which relates to the speed of read and write; second, the memory size, which affects the number of node addresses it can store. Under broadcast conditions as described above, the Ethernet switch design will indirectly effect the traffic in the network, thereby influencing the probability of data collision. The present invention focuses on the problem of memory size. As described above, the memory space in an Ethernet network switch is limited. Smaller memory space will decrease the number of node addresses recorded and increase the occurrence of broadcast, thereby increasing network traffic. On the other hand, memory size is limited by several practical considerations, such as limitations on physical space and cost. Therefore, the question of how to store more network node address information without sacrificing the network performances is an important one.
Therefore, an object of the present invention is to provide an architecture of address memory and a method of node address management, thereby allowing more network node address information to be stored in limited memory space and promoting the efficiency of the address memory. Another object of the present invention is to shorten the read/write bytes, thereby promoting the read/write speed of the node addresses.
The present invention achieves the above-indicated object by providing an address memory architecture for an Ethernet switch, comprising an index memory and an address table memory. The index memory comprises several vendor code index entries. Each of the vendor code index entries includes a vendor storage section and index section for storing the index of the vendor code in the corresponding vendor storage section. The address table memory comprises a plurality of address entries. Each of the address entries stores one node address and includes a first storage section and a second storage section. The first storage section is used for storing the index data of the vendor code of the node address. The second storage section is used for storing the serial code of the node address. While a new network node address is obtained, the vendor code of the new node address is compared with the index memory to determine the corresponding index data. If it exists already, then the corresponding index data is directly retrieved. If it does not exist, then a new entry in the index memory is created, and the new index data is retrieved. Finally, the index data and the serial code of the node address are written into the address table memory that records all the node addresses. Since the vendor codes are recorded by their corresponding index data, memory usage is improved and the access time for the these node addresses is reduced.